(function(){"use strict";BX.namespace("BX.rest.integration");BX.rest.integration={open:function(e,t){if(!!t){BX.SidePanel.Instance.open(t,{cacheable:false})}else{if(e){if(!!this.loadProcess){BX.UI.Notification.Center.notify({content:BX.message("REST_INTEGRATION_LIST_OPEN_PROCESS")});return false}else{this.loadProcess=true}BX.ajax.runComponentAction("bitrix:rest.integration.edit","getNewIntegrationUrl",{mode:"class",data:{code:e}}).then(function(e){if(!!e.data&&!!e.data.url){BX.SidePanel.Instance.open(e.data.url,{cacheable:false,requestMethod:"post",requestParams:{NEW_OPEN:"Y"},events:{onLoad:function(e){this.loadProcess=false}.bind(this)}})}else{if(!!e.data.helperCode&&e.data.helperCode!==""){top.BX.UI.InfoHelper.show(e.data.helperCode)}else{var t=BX.message("REST_INTEGRATION_LIST_ERROR_OPEN_URL");if(!!e.data.error&&e.data.error.length>0){t=e.data.error}BX.UI.Notification.Center.notify({content:t})}this.loadProcess=false}}.bind(this)).catch(function(e){BX.UI.Notification.Center.notify({content:BX.message("REST_INTEGRATION_LIST_ERROR_OPEN_URL")});this.loadProcess=false}.bind(this))}}}}})();
//# sourceMappingURL=integration.map.js